import { AppModel } from 'app/models/kdsConfig';
import { ConfigSvr } from './../../services/config';
import { AppStore } from './../../services/appStore';
import { SysSvr } from './../../services/system';
import { Terminal } from './../../models/terminal';
import { StoreSvr } from './../../services/store';
import { Http } from '@angular/http';
import { LoadMask } from './../../components/loadmask';
import { User } from './viewmodel';
import { NavigateService } from './../../services/navigate';
import { Authentication } from './../../services/authtication';
import { MessageBoxService, GrowlMessageType } from './../../components/messageBox';
import { Component, Directive, ElementRef, OnInit } from '@angular/core';
import { loadingMask } from './../../components/loadmask';


@Component({
    selector: 'check-mode',
    styleUrls: ['./initialization.scss'],
    template: `
        <div class="check_mode_container">
            <header>
                <i class="material-icons back divvma" (click)="onBack()">arrow_back</i>
                <h1 class="padding">选择出品台模式</h1>
                <div class="nav">
                    <i ></i>
                    <i ></i>
                    <i ></i>
                    <i class="active">4</i>
                    <i ></i>
                </div>
            </header>
            <div class="check_box" (click)="next(mode.FastFood)">
                <h3 class="title">传统快餐模式</h3>
                <p class="desc">传统快餐模式下，出品台会将所有订单平铺展示给你，适用于快餐业态</p>
            </div>
            <div class="check_box" (click)="next(mode.HotPot)">
                <h3 class="title">中餐火锅模式</h3>
                <p class="desc">中餐火锅模式下，出品台只会展示给你当前选中的订单，适用于中餐、火锅业态</p>
            </div>
        </div>
    `,
    providers: []
})

export class CheckMode {
    constructor(
        private navSvr: NavigateService,
        private storeSvr: StoreSvr,
        private appStore: AppStore,
        private configSvr: ConfigSvr
    ) {

    }

    private mode = AppModel;


    onBack() {
        this.navSvr.navigate(["initialization/remoteLogin"]);
    }
    next(mode) {
        const appConfig = this.configSvr.appConfig;
        appConfig.model = mode;
        this.configSvr.appConfig = appConfig;

        this.navSvr.navigate(["initialization/bindDevice"]);
    }
}
